<template>
    <web-view :src="url" @message="bindmessage" @load="bindload" @error="binderror"></web-view>
</template>

<script>
export default {
    data() {
        return {
            url: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log('=== device-live:cloud:onLoad:');
        let device = JSON.parse(options.device);
        const { userId, deviceNo, isPay } = device;
        const lan = 'zh';
        const goods = '';
        const uuid = deviceNo;
        const nickname = uni.getStorageSync('userInfo').nickName;
        const route = isPay ? 'orders' : '';
        const xm_appKey = getApp().globalData.appConfig.xm_appKey;
		this.url = 'http://10.10.18.96:8082/#/?authorization=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJycyIsImFwcEtleSI6IjY0NzVkYThjNDM1MzRiOGE4YzI4MTNlMzYyZGRhMWNiIiwiZXhwIjoxNjUwNzgzMDEwLCJ0eXBlIjoiY29tIiwiYWNjb3VudCI6IjZlZDg3NTE0ODYyZjMyMTFiNDRmZGNkZWU5NDAxMzRlIn0.ItNauUYkOpOKDaRnxEJCzkjn1MrNygr4GzypUSrOoZU.1&appKey=6475da8c43534b8a8c2813e362dda1cb'
	},
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
        console.log('=== device-live:cloud:onReady:');
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        console.log('=== device-live:cloud:onShow:');
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {
        console.log('--- device-live:cloud:onHide:');
    },
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {
        console.log('--- device-live:cloud:onUnload:');
    },
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function (options) {
        console.log('onShareAppMessage:', options, options.webViewUrl);
    },
    methods: {
        bindmessage(ev) {
            console.log('bindmessage:', ev);
        },

        bindload(ev) {
            console.log('bindload:', ev);
        },

        binderror(ev) {
            console.log('binderror:', ev);
        }
    }
};
</script>
<style></style>
